package com.za.wbw.service.shop.impl;

import java.util.List;
import java.util.Map;

import com.za.wbw.dao.shop.ProductDao;
import com.za.wbw.model.shop.ProductInfo;
import com.za.wbw.service.shop.ProductService;

public class ProductServiceImpl implements ProductService {
	private ProductDao productDao;
	
	// 查询产品列表
	public List<ProductInfo> queryProductPage(Map<String, Object> pars) throws Exception{
		return getProductDao().queryProductPage(pars);
	}
	// 查询产品总数
	public int queryProductCount(Map<String, Object> pars) throws Exception{
		return getProductDao().queryProductCount(pars);
	}
	// 查询产品信息
	public ProductInfo queryProductInfo(int productId) throws Exception{
		return getProductDao().queryProductInfo(productId);
	}
	// 保存产品信息
	public ProductInfo saveProductInfo(ProductInfo info) throws Exception{
		return getProductDao().saveProductInfo(info);
	}
	// 编辑产品信息
	public void updateProductInfo(ProductInfo info) throws Exception{
		getProductDao().updateProductInfo(info);
	}
	// 更新下架
	public void updateProductStatus(Map<String, Object> pars) throws Exception{
		getProductDao().updateProductStatus(pars);
	}
	// ------------------------------
	public ProductDao getProductDao() {
		return productDao;
	}

	public void setProductDao(ProductDao productDao) {
		this.productDao = productDao;
	}
}
